<style lang="scss" scoped>
	@import '@/assets/css/variable';
	.zixundetail {
		width: 100%;
		background-color: $main-bgc-white;
		min-height: 100%;
		font-size: 1.2rem;
		overflow-y: scroll;
		box-sizing: border-box;
		flex:1;
		padding: 1.6rem;
		.titleLine{
			display: flex;
			justify-content: space-between;
			.title{
				flex: 1;
				font-size: 1.8rem;
				line-height: 1.3em;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				/* 设置行数 */
				-webkit-box-orient: vertical;
				overflow: hidden;
				color: #191F25;
			}
			.collect{
				flex: 0 0 5rem;
				display: flex;
				align-items: center;
				justify-content: center;
				text-align: right;
				.box{
				  flex: 0 0 3.6rem;
				  display: flex;
				  flex-direction: column;
				  align-items: center;
				  .icon{
					   width: 2rem;
					  img{
						  width: 2rem;
					  }
				  }
				  .text{
					  font-size: 1.3rem;
					  color: $color3;
				  }
				}
			}
		}
		.infoLine{
			height: 4rem;
			line-height: 4rem;
			border-bottom: 1px solid #f7f7f7;
			color: $color3;
			display: flex;
			align-items: center;
		}
		.contentLine{
			padding: 1rem 0;
			color: $color2;
			line-height:1.4em;
			font-size: 1.3rem;
			letter-spacing: 1px;
		}
		.fix-bottom{
			position: fixed;
			bottom: 6px;
			left: 12px;
			right: 12px;
			.btn{
				height: 40px;
				line-height: 40px;
				/* 表单底色 */
				background: #F5F7FA;
				/* 分割线用色 */
				
				border: 1px solid #F0F2F5;
				box-sizing: border-box;
				border-radius: 8px;
				text-align: center;
				color: #707070;
				font-size: 16px;
			}
		}
		.popBox{
			padding: 12px 13px;
			.title{
				font-size: 16px;
				color: #191F25;
				padding-bottom: 12px;
			}
			.list{
				.item{
					padding: 12px 0;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 14px;
					border-top: 1px solid #f7f7f7;
					.text{
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp:1; /* 设置行数 */
						-webkit-box-orient:vertical;
						color: #191F25;
					}
					.downBtn{
						color: $mainColor;
						flex: 0 0 50px;
						text-align: right;
					}
					&:last-child{
						border-bottom: 1px solid #f7f7f7;
					}
				}
			}
		}
	}
</style>
<template>
	<div class="zixundetail">
    <!-- <bar-nav @getBack="getBack" @backHome="backHome" :title="title"></bar-nav> -->
		<div class="titleLine">
			<div class="title">
				{{zixunItem.title}}
			</div>
		</div>


		<div class="infoLine">
			<span class="margL-s">{{zixunItem.unit}}</span>
			<span class="margL-l">{{zixunItem.createTime}}</span>
		</div>
		<div class="contentLine">
			{{StickTitle(zixunItem.content)}}
		</div>
		<!-- <div class="fix-bottom">
			<div class="btn" @click="downloadBtn">下载附件</div>
		</div> -->
		<!-- <van-popup v-model="showPop" position="bottom" round :style="{ height: '50%' }">
			<div class="popBox">
				<div class="title">附件列表(1条)
           </div>
				<div class="list">
					<div class="item">
						<span class="text">{{zixunItem.title}}</span>
						<a @click="downFile" class="downBtn">下载</a>
					</div>
				</div>
			</div>
		</van-popup>  -->
	</div>
</template>

<script>
	// @ is an alias to /src
	import {Toast} from 'vant'
	import {
		myMixins
	} from "@/assets/js/mixins.js"
  import BarNav from '@/components/BarNav'
	export default {
		name: "zixundetail",
		mixins: [myMixins],
		components: {
			BarNav
		},
		data() {
			return {
				// showPop:false,
        title: '详情',
        zixunItem: {}
			}
		},
		// 处理文本标签
		computed: {
		StickTitle() {
		return function(value) {
			let reg=/<\/?.+?\/?>/g;
			return value.replace(reg, '')
		}
		}
		},
		created() {
    //   console.log("this.$store.state.infoData---created",this.$store.state.infoData)
		  this.zixunItem = this.$store.state.infoData
		},
		mounted() {
    },
		methods: {
          // 请求公开信息
      dataList() {
      },
			// downloadBtn() {
			// 	this.showPop = true
			// },
      downFile() {
        let a = document.createElement('a')
        a.href = this.zixunItem.img
        a.click()
        this.showPop = false
      },
      
			ArticleItem() {
				const _this = this;
				let params = {
					id: this.$route.query.id,
				}
				_this.$request.ArticleItem(params).then(res => {
					if(res.ret==200){
						this.zixunItem = res.data
					}
				})
			},
		}
	};
</script>
